﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo
{
    class Calculate
    {
        protected int num1;
        protected int num2;

        public int Num1
        {
            get { return this.num1; }
            set { this.num1 = value; }
        }
        public int Num2
        {
            get { return this.num2; }
            set { this.num2 = value; }
        }
        public virtual void DisplayResult()
        {

        }
    }
    class Add : Calculate
    {
        public override void DisplayResult()
        {
            base.DisplayResult();
            Console.WriteLine(num1 + "+" + num2 + "=" + (num1 + num2));
        }
    }
    class jianfa : Calculate
    {
        public override void DisplayResult()
        {
            base.DisplayResult();
            Console.WriteLine(num1 + "-" + num2 + "=" + (num1 - num2));
        }
    }
    class chenfa : Calculate
    {
        public override void DisplayResult()
        {
            base.DisplayResult();
            Console.WriteLine(num1 + "*" + num2 + "=" + (num1 * num2));
        }
    }
    class chufa : Calculate
    {
        public override void DisplayResult()
        {
            base.DisplayResult();
            Console.WriteLine(num1 + "/" + num2 + "=" + (num1 / num2));
        }
    }
}

